package com.jinxiangyang.utils.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author jinxiangyang
 * @date 2023/8/11 16:07
 * @description TODO
 **/

@Data
@Configuration
@ConfigurationProperties(prefix = "minio")
public class MinioConfig {

    private String endpoint;
    private String bucketName;

    private String accessKey;
    private String secretKey;


    @Bean
    public MinioClient minioClient() {
       return MinioClient
               .builder().endpoint(endpoint).credentials(accessKey,secretKey)
               .build();
    }
}


